package com.atguigu.flink.source;

import org.apache.flink.api.common.eventtime.WatermarkStrategy;
import org.apache.flink.connector.file.src.FileSource;
import org.apache.flink.connector.file.src.reader.TextLineInputFormat;
import org.apache.flink.core.fs.Path;
import org.apache.flink.streaming.api.environment.StreamExecutionEnvironment;

public class GetSourceFromFile {

    public static void main(String[] args) throws Exception {

        StreamExecutionEnvironment env = StreamExecutionEnvironment.getExecutionEnvironment();

//        DataStreamSource<String> ds = env.readTextFile();

        FileSource<String> source = FileSource. forRecordStreamFormat(
                new TextLineInputFormat() , new Path(""))
                .build();

        env.fromSource(source , WatermarkStrategy.noWatermarks() , "fileSource");

        env.execute();
    }
}
